
package com.middlegroup.common.utils;

import java.io.UnsupportedEncodingException;
import org.apache.commons.codec.binary.Base64;

/**
 * @author pc
 */
public class Base64Utils {
    public Base64Utils() {
    }

    public static byte[] encode(byte[] binaryData) {
        return Base64.encodeBase64(binaryData);
    }

    public static byte[] decode(String base64String) {
        try {
            byte[] e = base64String.getBytes("ASCII");
            byte[] ret = Base64.decodeBase64(e);
            return ret;
        } catch (UnsupportedEncodingException var3) {
            throw new RuntimeException(var3);
        }
    }
}
